package com.uduemc.biso.module.basic.service.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.uduemc.biso.core.extities.center.SysLanguage;
import com.uduemc.biso.module.basic.service.mapper.SysLanguageMapper;
import com.uduemc.biso.module.basic.service.service.SysLanguageService;

@Service
public class SysLanguageServiceImpl implements SysLanguageService {

	@Autowired
	private SysLanguageMapper sysLanguageMapper;

	@Override
	public SysLanguage insert(SysLanguage sysLanguage) {
		sysLanguageMapper.insertSelective(sysLanguage);
		return findOne(sysLanguage.getId());
	}

	@Override
	public SysLanguage updateById(SysLanguage sysLanguage) {
		sysLanguageMapper.updateByPrimaryKeySelective(sysLanguage);
		return findOne(sysLanguage.getId());
	}

	@Override
	public SysLanguage findOne(Long id) {
		return sysLanguageMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<SysLanguage> findAll() {
		return sysLanguageMapper.selectAll();
	}

	@Override
	public void deleteById(Long id) {
		sysLanguageMapper.deleteByPrimaryKey(id);
	}

}
